home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / bbs / termv4.6 / extras / source / term-source.lha / gtlayout.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-18  |  28.8 KB  |  857 lines

  1. /*
  2. **    $VER: gtlayout.h 30.3 (25.12.95)
  3. **    GadTools layout toolkit
  4. **
  5. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  6. **        Freely distributable.
  7. **
  8. **    :ts=8
  9. */
  10.  
  11. #ifndef _GTLAYOUT_H
  12. #define _GTLAYOUT_H
  13.  
  14.  
  15. /*****************************************************************************/
  16.  
  17.  
  18. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(SHARED_LIB) && !defined(LINK_LIB)
  19. #define SHARED_LIB 1
  20. #endif
  21.  
  22. #ifdef _DCC
  23. #ifndef __stdargs
  24. #define __stdargs __stkargs
  25. #endif    /* __stdargs */
  26. #ifndef __asm
  27. #define __asm
  28. #endif    /* __asm */
  29. #endif    /* _DCC */
  30.  
  31. #ifdef _GTLAYOUT_GLOBAL_H
  32. #define _REG(x)    register __ ## x
  33. #define REG(x)    register __ ## x
  34. #define LIBENT    __saveds __asm
  35. #endif    /* _GTLAYOUT_GLOBAL_H */
  36.  
  37. #ifdef SHARED_LIB
  38. #define _REG(x)
  39. #define LIBENT
  40. #endif    /* SHARED_LIB */
  41.  
  42. #ifdef LINK_LIB
  43. #define _REG(x)
  44. #define LIBENT
  45. #endif    /* LINK_LIB */
  46.  
  47.  
  48. /*****************************************************************************/
  49.  
  50.  
  51. #ifndef EXEC_TYPES_H
  52. #include <exec/types.h>
  53. #endif
  54.  
  55. #ifndef INTUITION_INTUITION_H
  56. #include <intuition/intuition.h>
  57. #endif
  58.  
  59. #ifndef UTILITY_TAGITEM_H
  60. #include <utility/tagitem.h>
  61. #endif
  62.  
  63. #ifndef INTUITION_GADGETCLASS_H
  64. #include <intuition/gadgetclass.h>
  65. #endif
  66.  
  67. #ifndef LIBRARIES_GADTOOLS_H
  68. #include <libraries/gadtools.h>
  69. #endif
  70.  
  71.  
  72. /*****************************************************************************/
  73.  
  74.  
  75. /* Where to place a gadget label */
  76. enum
  77. {
  78.     PLACE_Left,
  79.     PLACE_Right,
  80.     PLACE_Above,
  81.     PLACE_In,
  82.     PLACE_Below
  83. };
  84.  
  85. /* How to align text lines in BOX_KIND gadgets */
  86. enum
  87. {
  88.     ALIGNTEXT_Left,
  89.     ALIGNTEXT_Centered,
  90.     ALIGNTEXT_Right,
  91.     ALIGNTEXT_Pad
  92. };
  93.  
  94. /* The button images available for TAPEDECK_KIND gadgets. */
  95. enum
  96. {
  97.     TDBT_Backward,
  98.     TDBT_Forward,
  99.     TDBT_Previous,
  100.     TDBT_Next,
  101.     TDBT_Stop,
  102.     TDBT_Pause,
  103.     TDBT_Record,
  104.     TDBT_Rewind,
  105.     TDBT_Eject,
  106.     TDBT_Play,
  107.  
  108.     TDBTLAST
  109. };
  110.  
  111. /* How to align the window opened by LT_Build() on the screen. */
  112. #define ALIGNF_Right        (1 << 0)
  113. #define ALIGNF_Left        (1 << 1)
  114. #define ALIGNF_Top        (1 << 2)
  115. #define ALIGNF_Bottom        (1 << 3)
  116. #define ALIGNF_ExtraRight    (1 << 4)
  117. #define ALIGNF_ExtraLeft    (1 << 5)
  118. #define ALIGNF_ExtraTop        (1 << 6)
  119. #define ALIGNF_ExtraBottom    (1 << 7)
  120.  
  121. /* Handy for LT_LevelWidth and LT_NewLevelWidth */
  122. typedef LONG (* __stdargs DISPFUNC)(struct Gadget *gad,LONG value);
  123.  
  124.  
  125. /*****************************************************************************/
  126.  
  127.  
  128. /* Generic tags, applicable for several object types */
  129. #define LA_Chars        TAG_USER+2
  130. #define LA_LabelPlace        TAG_USER+3
  131. #define LA_ExtraSpace        TAG_USER+4
  132. #define LA_NoKey        TAG_USER+30
  133. #define LA_HighLabel        TAG_USER+31
  134. #define LA_LabelText        TAG_USER+37
  135. #define LA_LabelID        TAG_USER+38
  136. #define LA_ID            TAG_USER+39
  137. #define LA_Type            TAG_USER+40
  138. #define LA_PageSelector        TAG_USER+79
  139. #define LA_LabelChars        TAG_USER+107
  140.  
  141. /* Storage type tags */
  142. #define LA_BYTE            TAG_USER+63
  143. #define LA_UBYTE        TAG_USER+64
  144. #define LA_WORD            TAG_USER+65
  145. #define LA_BOOL            TAG_USER+65
  146. #define LA_UWORD        TAG_USER+66
  147. #define LA_LONG            TAG_USER+67
  148. #define LA_ULONG        TAG_USER+68
  149. #define LA_STRPTR        TAG_USER+69
  150. #define LA_FRACTION        TAG_USER+68
  151.  
  152. /* for use with LT_GetAttributes() only */
  153. #define LA_Left            TAG_USER+16
  154. #define LA_Top            TAG_USER+17
  155. #define LA_Width        TAG_USER+18
  156. #define LA_Height        TAG_USER+19
  157. #define LA_LabelLeft        TAG_USER+114
  158. #define LA_LabelTop        TAG_USER+115
  159.  
  160. /* BOOPSI_KIND */
  161. #define LABO_TagCurrent        TAG_USER+119
  162. #define LABO_TagTextAttr    TAG_USER+120
  163. #define LABO_TagDrawInfo    TAG_USER+121
  164. #define LABO_TagLink        TAG_USER+129
  165. #define LABO_TagScreen        TAG_USER+132
  166. #define LABO_Link        LALV_Link
  167. #define LABO_ClassInstance    TAG_USER+122
  168. #define LABO_ClassName        TAG_USER+123
  169. #define LABO_ClassLibraryName    TAG_USER+124
  170. #define LABO_ExactWidth        TAG_USER+127
  171. #define LABO_ExactHeight    TAG_USER+128
  172. #define LABO_RelFontHeight    TAG_USER+131
  173. #define LABO_Object        TAG_USER+133
  174. #define LABO_FullWidth        TAG_USER+135
  175. #define LABO_FullHeight        TAG_USER+136
  176. #define LABO_ActivateHook    TAG_USER+141
  177.  
  178. /* BOX_KIND */
  179. #define LABX_Labels        TAG_USER+12
  180. #define LABX_Lines        TAG_USER+13
  181. #define LABX_Chars        TAG_USER+2
  182. #define LABX_Rows        TAG_USER+1
  183. #define LABX_Index        TAG_USER+14
  184. #define LABX_Text        TAG_USER+15
  185. #define LABX_AlignText        TAG_USER+27
  186. #define LABX_DrawBox        TAG_USER+11
  187. #define LABX_FirstLabel        TAG_USER+44
  188. #define LABX_LastLabel        TAG_USER+45
  189. #define LABX_ReserveSpace    TAG_USER+72
  190. #define LABX_LabelTable        TAG_USER+98
  191. #define LABX_FirstLine        TAG_USER+152
  192. #define LABX_LastLine        TAG_USER+153
  193. #define LABX_LineTable        TAG_USER+156
  194. #define LABX_Line        TAG_USER+161
  195. #define LABX_LineID        TAG_USER+162
  196.  
  197. /* BUTTON_KIND */
  198. #define LABT_ReturnKey        TAG_USER+34
  199. #define LABT_DefaultButton    TAG_USER+34
  200. #define LABT_EscKey        TAG_USER+56
  201. #define LABT_ExtraFat        TAG_USER+29
  202. #define LABT_Lines        TAG_USER+140
  203. #define LABT_FirstLine        TAG_USER+44
  204. #define LABT_LastLine        TAG_USER+45
  205. #define LABT_DefaultCorrection    TAG_USER+145
  206. #define LABT_Smaller        TAG_USER+147
  207.  
  208. /* CYCLE_KIND */
  209. #define LACY_FirstLabel        TAG_USER+44
  210. #define LACY_LastLabel        TAG_USER+45
  211. #define LACY_LabelTable        TAG_USER+98
  212. #define LACY_AutoPageID        TAG_USER+103
  213. #define LACY_TabKey        TAG_USER+118
  214.  
  215. /* FRACTION_KIND */
  216. #define LAFC_MaxChars        TAG_USER+20
  217. #define LAFC_Number        TAG_USER+21
  218. #define LAFC_LastGadget        TAG_USER+28
  219. #define LAFC_Min        TAG_USER+23
  220. #define LAFC_Max        TAG_USER+24
  221. #define LAFC_HistoryLines    TAG_USER+59
  222. #define LAFC_HistoryHook    TAG_USER+80
  223. #define LAFC_Activate        TAG_USER+148
  224.  
  225. /* FRAME_KIND */
  226. #define LAFR_InnerWidth        TAG_USER+9
  227. #define LAFR_InnerHeight    TAG_USER+10
  228. #define LAFR_DrawBox        TAG_USER+11
  229. #define LAFR_RefreshHook    TAG_USER+117
  230. #define LAFR_GenerateEvents    TAG_USER+155
  231.  
  232. /* GAUGE_KIND */
  233. #define LAGA_Percent        TAG_USER+36
  234. #define LAGA_InfoLength        TAG_USER+70
  235. #define LAGA_InfoText        TAG_USER+71
  236. #define LAGA_NoTicks        TAG_USER+143
  237. #define LAGA_Discrete        TAG_USER+144
  238. #define LAGA_Tenth        TAG_USER+144
  239.  
  240. /* INTEGER_KIND */
  241. #define LAIN_LastGadget        TAG_USER+28
  242. #define LAIN_Min        TAG_USER+23
  243. #define LAIN_Max        TAG_USER+24
  244. #define LAIN_UseIncrementers    TAG_USER+57
  245. #define LAIN_Incrementers    TAG_USER+57
  246. #define LAIN_HistoryLines    TAG_USER+59
  247. #define LAIN_HistoryHook    TAG_USER+80
  248. #define LAIN_IncrementerHook    TAG_USER+85
  249. #define LAIN_Activate        TAG_USER+148
  250.  
  251. /* LISTVIEW_KIND */
  252. #define LALV_ExtraLabels    TAG_USER+26
  253. #define LALV_Labels        TAG_USER+33
  254. #define LALV_CursorKey        TAG_USER+35
  255. #define LALV_Columns        TAG_USER+2
  256. #define LALV_Lines        TAG_USER+1
  257. #define LALV_Link        TAG_USER+7
  258. #define LALV_FirstLabel        TAG_USER+44
  259. #define LALV_LastLabel        TAG_USER+45
  260. #define LALV_MaxGrowX        TAG_USER+77
  261. #define LALV_MaxGrowY        TAG_USER+78
  262. #define LALV_LabelTable        TAG_USER+98
  263. #define LALV_LockSize        TAG_USER+106
  264. #define LALV_ResizeX        TAG_USER+109
  265. #define LALV_ResizeY        TAG_USER+110
  266. #define LALV_MinChars        TAG_USER+111
  267. #define LALV_MinLines        TAG_USER+112
  268. #define LALV_FlushLabelLeft    TAG_USER+113
  269. #define LALV_TextAttr        TAG_USER+138
  270. #define LALV_AutoPageID        TAG_USER+103
  271.  
  272. /* LEVEL_KIND */
  273. #define LAVL_Min        GTSL_Min
  274. #define LAVL_Max        GTSL_Max
  275. #define LAVL_Level        GTSL_Level
  276. #define LAVL_LevelFormat    GTSL_LevelFormat
  277. #define LAVL_LevelPlace        GTSL_LevelPlace
  278. #define LAVL_DispFunc        GTSL_DispFunc
  279. #define LAVL_FullCheck        LASL_FullCheck
  280.  
  281. /* MX_KIND */
  282. #define LAMX_FirstLabel        TAG_USER+44
  283. #define LAMX_LastLabel        TAG_USER+45
  284. #define LAMX_LabelTable        TAG_USER+98
  285. #define LAMX_TabKey        TAG_USER+118
  286. #define LAMX_AutoPageID        TAG_USER+103
  287.  
  288. /* PALETTE_KIND */
  289. #define LAPA_SmallPalette    TAG_USER+32
  290. #define LAPA_Lines        LA_Lines
  291. #define LAPA_UsePicker        TAG_USER+137
  292. #define LAPA_Picker        TAG_USER+137
  293.  
  294. /* PASSWORD_KIND */
  295. #define LAPW_String             GTST_String
  296. #define LAPW_LastGadget        TAG_USER+28
  297. #define LAPW_HistoryLines    TAG_USER+59
  298. #define LAPW_HistoryHook    TAG_USER+80
  299. #define LAPW_Activate        TAG_USER+148
  300. #define LAPW_MaxChars        GTST_MaxChars
  301.  
  302. /* POPUP_KIND */
  303. #define LAPU_FirstLabel        TAG_USER+44
  304. #define LAPU_LastLabel        TAG_USER+45
  305. #define LAPU_LabelTable        TAG_USER+98
  306. #define LAPU_AutoPageID        TAG_USER+103
  307. #define LAPU_TabKey        TAG_USER+118
  308. #define LAPU_Labels        GTCY_Labels
  309. #define LAPU_Active        GTCY_Active
  310. #define LAPU_CentreActive    TAG_USER+163
  311.  
  312. /* SLIDER_KIND */
  313. #define LASL_FullCheck        TAG_USER+22
  314.  
  315. /* SCROLLER_KIND */
  316. #define LASC_Thin        TAG_USER+62
  317.  
  318. /* STRING_KIND */
  319. #define LAST_LastGadget        TAG_USER+28
  320. #define LAST_Link        TAG_USER+7
  321. #define LAST_Picker        TAG_USER+5
  322. #define LAST_UsePicker        TAG_USER+5
  323. #define LAST_HistoryLines    TAG_USER+59
  324. #define LAST_HistoryHook    TAG_USER+80
  325. #define LAST_CursorPosition    TAG_USER+105
  326. #define LAST_Activate        TAG_USER+148
  327.  
  328. /* TAB_KIND */
  329. #define LATB_FirstLabel        TAG_USER+44
  330. #define LATB_LastLabel        TAG_USER+45
  331. #define LATB_LabelTable        TAG_USER+98
  332. #define LATB_AutoPageID        TAG_USER+103
  333. #define LATB_TabKey        TAG_USER+118
  334. #define LATB_Labels        GTCY_Labels
  335. #define LATB_Active        GTCY_Active
  336. #define LATB_FullWidth        TAG_USER+149
  337. #define LATB_FullSize        TAG_USER+149
  338.  
  339. /* TAPEDECK_KIND */
  340. #define LATD_ButtonType        TAG_USER+86
  341. #define LATD_Toggle        TAG_USER+87
  342. #define LATD_Pressed        TAG_USER+88
  343. #define LATD_Smaller        TAG_USER+89
  344. #define LATD_Tick        TAG_USER+139
  345.  
  346. /* TEXT_KIND */
  347. #define LATX_Picker        TAG_USER+5
  348. #define LATX_UsePicker        TAG_USER+5
  349. #define LATX_LockSize        TAG_USER+106
  350.  
  351. /* VERTICAL_KIND, HORIZONTAL_KIND */
  352. #define LAGR_Spread        TAG_USER+6
  353. #define LAGR_SameSize        TAG_USER+8
  354. #define LAGR_LastAttributes    TAG_USER+46
  355. #define LAGR_ActivePage        TAG_USER+58
  356. #define LAGR_Frame        TAG_USER+104
  357. #define LAGR_IndentX        TAG_USER+130
  358. #define LAGR_IndentY        TAG_USER+134
  359. #define LAGR_NoIndent        TAG_USER+146
  360. #define LAGR_SameWidth        TAG_USER+150
  361. #define LAGR_SameHeight        TAG_USER+151
  362.  
  363. /* XBAR_KIND */
  364. #define LAXB_FullSize        TAG_USER+50
  365. #define LAXB_FullWidth        TAG_USER+50
  366.  
  367. /* Applicable for layout handle only */
  368. #define LAHN_TextAttr        TAG_USER+41
  369. #define LAHN_AutoActivate    TAG_USER+42
  370. #define LAHN_LocaleHook        TAG_USER+4
  371. #define LAHN_CloningPermitted    TAG_USER+61
  372. #define LAHN_EditHook        TAG_USER+74
  373. #define LAHN_ExactClone        TAG_USER+75
  374. #define LAHN_MenuGlyphs        TAG_USER+76
  375. #define LAHN_Parent        TAG_USER+83
  376. #define LAHN_BlockParent    TAG_USER+84
  377. #define LAHN_SimpleClone    TAG_USER+90
  378. #define LAHN_ExitFlush        TAG_USER+108
  379. #define LAHN_UserData        TAG_USER+116
  380. #define LAHN_RawKeyFilter    TAG_USER+142
  381. #define LAHN_DontPickShortcuts    TAG_USER+154
  382. #define LAHN_NoKeys        TAG_USER+154
  383. #define LAHN_PubScreen        TAG_USER+157
  384. #define LAHN_PubScreenName    TAG_USER+158
  385. #define LAHN_PubScreenFallBack    TAG_USER+159
  386.  
  387. /* Applicable for menus only. */
  388. #define LAMN_FirstLabel        LABX_FirstLabel
  389. #define LAMN_LastLabel        LABX_LastLabel
  390. #define LAMN_LabelTable        TAG_USER+98
  391. #define LAMN_TitleText        TAG_USER+17000
  392. #define LAMN_TitleID        TAG_USER+17001
  393. #define LAMN_ItemText        TAG_USER+17002
  394. #define LAMN_ItemID        TAG_USER+17003
  395. #define LAMN_SubText        TAG_USER+17004
  396. #define LAMN_SubID        TAG_USER+17005
  397. #define LAMN_KeyText        TAG_USER+17006
  398. #define LAMN_KeyID        TAG_USER+17007
  399. #define LAMN_CommandText    TAG_USER+17008
  400. #define LAMN_CommandID        TAG_USER+17009
  401. #define LAMN_MutualExclude    TAG_USER+17010
  402. #define LAMN_UserData        TAG_USER+17011
  403. #define LAMN_Disabled        TAG_USER+17012
  404. #define LAMN_CheckIt        TAG_USER+17013
  405. #define LAMN_Checked        TAG_USER+17014
  406. #define LAMN_Toggle        TAG_USER+17015
  407. #define LAMN_Code        TAG_USER+17016
  408. #define LAMN_Qualifier        TAG_USER+17017
  409. #define LAMN_Char        TAG_USER+17018
  410. #define LAMN_ID            TAG_USER+17019
  411. #define LAMN_AmigaGlyph        TAG_USER+17020
  412. #define LAMN_CheckmarkGlyph    TAG_USER+17021
  413. #define LAMN_Error        TAG_USER+17022
  414. #define LAMN_Screen        TAG_USER+17023
  415. #define LAMN_TextAttr        TAG_USER+17024
  416. #define LAMN_LayoutHandle    TAG_USER+17025
  417. #define LAMN_Handle        TAG_USER+17025
  418. #define LAMN_ExtraSpace        TAG_USER+17026
  419. #define LAMN_FullMenuNum    TAG_USER+160
  420.  
  421. /* Applicable for window only */
  422. #define LAWN_Menu        TAG_USER+25
  423. #define LAWN_UserPort        TAG_USER+47
  424. #define LAWN_Left        TAG_USER+48
  425. #define LAWN_Top        TAG_USER+49
  426. #define LAWN_Zoom        TAG_USER+50
  427. #define LAWN_MaxPen        TAG_USER+52
  428. #define LAWN_BelowMouse        TAG_USER+53
  429. #define LAWN_MoveToWindow    TAG_USER+54
  430. #define LAWN_AutoRefresh    TAG_USER+55
  431. #define LAWN_HelpHook        TAG_USER+73
  432. #define LAWN_Parent        TAG_USER+81
  433. #define LAWN_BlockParent    TAG_USER+82
  434. #define LAWN_SmartZoom        TAG_USER+91
  435. #define LAWN_Title        TAG_USER+92
  436. #define LAWN_TitleText        TAG_USER+92
  437. #define LAWN_Bounds        TAG_USER+93
  438. #define LAWN_ExtraWidth        TAG_USER+94
  439. #define LAWN_ExtraHeight    TAG_USER+95
  440. #define LAWN_IDCMP        TAG_USER+96
  441. #define LAWN_AlignWindow    TAG_USER+97
  442. #define LAWN_TitleID        TAG_USER+99
  443. #define LAWN_FlushLeft        TAG_USER+14000    /* NOTEZ-BIEN: TAG_USER+99 = WA_Dummy and can clash */
  444. #define LAWN_FlushTop        TAG_USER+14001    /*             with Intuition!                      */
  445. #define LAWN_Show        TAG_USER+14002
  446. #define LAWN_MenuTemplate    TAG_USER+14003
  447. #define LAWN_MenuTags        TAG_USER+14004
  448. #define LAWN_NoInitialRefresh    TAG_USER+164
  449.  
  450. /* Private tags; do not use, or you'll run into trouble! */
  451. #define LA_Private1        TAG_USER+100
  452. #define LA_Private2        TAG_USER+101
  453.  
  454. /* Last tag item value used */
  455. #define LAST_TAG        TAG_USER+164
  456.  
  457.  
  458. /*****************************************************************************/
  459.  
  460.  
  461. /* Identifies the absence of a link for a listview or a string gadget */
  462. #define NIL_LINK        -2
  463.  
  464.  
  465. /*****************************************************************************/
  466.  
  467.  
  468.     /* String gadget type history hook support: you will either get
  469.      * the following value passed as the message parameter to your
  470.      * hook function, or a pointer to a null-terminated string you should
  471.      * copy and create a Node from, which you should then add to the tail
  472.      * of your history list. Place a pointer to your history list in the
  473.      * Hook.h_Data entry.
  474.      */
  475.  
  476. #define HISTORYHOOK_DiscardOldest    0    /* Discard oldest entry */
  477.  
  478.  
  479. /*****************************************************************************/
  480.  
  481.  
  482.     /* Refresh hook support: you will get the following structure
  483.      * passed as the message and a pointer to the LayoutHandle as
  484.      * the object.
  485.      */
  486.  
  487. typedef struct RefreshMsg
  488. {
  489.     LONG    ID;
  490.     WORD    Left,
  491.         Top,
  492.         Width,
  493.         Height;
  494. } RefreshMsg;
  495.  
  496. /*****************************************************************************/
  497.  
  498.  
  499.     /* Incrementer hook support: you will get the current value
  500.      * passed as the object and one of the following values as
  501.      * the message. Return the number to be used.
  502.      */
  503.  
  504. enum
  505. {
  506.     INCREMENTERMSG_Decrement = -1,    /* Decrement value */
  507.     INCREMENTERMSG_Initial   =  0,    /* Initial value passed upon gadget creation */
  508.     INCREMENTERMSG_Increment =  1    /* Increment value */
  509. };
  510.  
  511.  
  512. /*****************************************************************************/
  513.  
  514.     /* Help key hook support: the hook will be called with a "struct IBox *"
  515.      * as the object and a "struct HelpMsg *". The IBox describes the object
  516.      * the mouse was positioned over, such as a button, a listview, etc.
  517.      * The "ObjectID" will indicate the ID of the object the mouse was
  518.      * positioned over. The ID will be -1 if no object was to be found.
  519.      */
  520.  
  521. typedef struct HelpMsg
  522. {
  523.     struct LayoutHandle    *Handle;    /* Window layout handle */
  524.     LONG             ObjectID;    /* ID of the object, -1 for full window */
  525. } HelpMsg;
  526.  
  527.  
  528. /*****************************************************************************/
  529.  
  530.  
  531. /* Obsolete tags, don't use in new code */
  532. #define LA_Lines        LABX_Rows
  533. #define LA_Spread        LAGR_Spread
  534. #define LA_SameSize        LAGR_SameSize
  535. #define LA_FullCheck        LASL_FullCheck
  536. #define LA_ExtraLabels        LALV_ExtraLabels
  537. #define LA_LastGadget        LAFC_LastGadget
  538. #define LA_SmallPalette        LAPA_SmallPalette
  539. #define LA_Labels        LALV_Labels
  540. #define LA_Picker        LATX_Picker
  541. #define LA_DrawBox        LAFR_DrawBox
  542. #define LA_FirstLabel        LABX_FirstLabel
  543. #define LA_LastLabel        LABX_LastLabel
  544. #define LA_LabelTable        LABX_LabelTable
  545. #define LA_Min            LAFC_Min
  546. #define LA_Max            LAFC_Max
  547. #define LA_Link            LALV_Link
  548. #define LA_Menu            LAWN_Menu
  549. #define LA_HistoryLines        LAST_HistoryLines
  550. #define LA_HistoryHook        LAST_HistoryHook
  551. #define LA_ReturnKey        LABT_ReturnKey
  552. #define LA_ExtraFat        LABT_ExtraFat
  553. #define LA_CursorKey        LALV_CursorKey
  554. #define STORE_BYTE        TAG_USER+63
  555. #define STORE_UBYTE        TAG_USER+64
  556. #define STORE_WORD        TAG_USER+65
  557. #define STORE_BOOL        TAG_USER+65
  558. #define STORE_UWORD        TAG_USER+66
  559. #define STORE_LONG        TAG_USER+67
  560. #define STORE_ULONG        TAG_USER+68
  561. #define STORE_STRPTR        TAG_USER+69
  562. #define STORE_FRACTION        TAG_USER+68
  563. #define LAHN_Font        TAG_USER+41
  564. #define LH_Font            TAG_USER+41
  565. #define LH_AutoActivate        TAG_USER+42
  566. #define LH_LocaleHook        TAG_USER+4
  567. #define LH_CloningPermitted    TAG_USER+61
  568. #define LH_EditHook        TAG_USER+74
  569. #define LH_ExactClone        TAG_USER+75
  570. #define LH_MenuGlyphs        TAG_USER+76
  571. #define LH_Parent        TAG_USER+83
  572. #define LH_BlockParent        TAG_USER+84
  573. #define LH_SimpleClone        TAG_USER+90
  574. #define LH_ExitFlush        TAG_USER+108
  575. #define LH_UserData        TAG_USER+116
  576. #define LH_RawKeyFilter        TAG_USER+142
  577.  
  578.  
  579. /* Obsolete defines, don't use in new code */
  580. #define PLACE_LEFT        PLACE_Left
  581. #define PLACE_RIGHT        PLACE_Right
  582. #define PLACE_ABOVE        PLACE_Above
  583. #define PLACE_IN        PLACE_In
  584. #define PLACE_BELOW        PLACE_Below
  585.  
  586. #define ALIGNTEXT_LEFT        ALIGNTEXT_Left
  587. #define ALIGNTEXT_CENTERED    ALIGNTEXT_Centered
  588. #define ALIGNTEXT_RIGHT        ALIGNTEXT_Right
  589. #define ALIGNTEXT_PAD        ALIGNTEXT_Pad
  590.  
  591. #define TDBT_BACKWARD        TDBT_Backward
  592. #define TDBT_FORWARD        TDBT_Forward
  593. #define TDBT_PREVIOUS        TDBT_Previous
  594. #define TDBT_NEXT        TDBT_Next
  595. #define TDBT_STOP        TDBT_Stop
  596. #define TDBT_PAUSE        TDBT_Pause
  597. #define TDBT_RECORD        TDBT_Record
  598. #define TDBT_REWIND        TDBT_Rewind
  599. #define TDBT_EJECT        TDBT_Eject
  600. #define TDBT_PLAY        TDBT_Play
  601.  
  602. #define ALIGNF_RIGHT        ALIGNF_Right
  603. #define ALIGNF_LEFT        ALIGNF_Left
  604. #define ALIGNF_TOP        ALIGNF_Top
  605. #define ALIGNF_BOTTOM        ALIGNF_Bottom
  606. #define ALIGNF_EXTRA_RIGHT    ALIGNF_ExtraRight
  607. #define ALIGNF_EXTRA_LEFT    ALIGNF_ExtraLeft
  608. #define ALIGNF_EXTRA_TOP    ALIGNF_ExtraTop
  609. #define ALIGNF_EXTRA_BOTTOM    ALIGNF_ExtraBottom
  610.  
  611. #define HISTORYHOOK_DISCARD_OLDEST    HISTORYHOOK_DiscardOldest
  612.  
  613. #define INCREMENTERMSG_DECREMENT    INCREMENTERMSG_Decrement
  614. #define INCREMENTERMSG_INITIAL        INCREMENTERMSG_Initial
  615. #define INCREMENTERMSG_INCREMENT    INCREMENTERMSG_Increment
  616.  
  617.  
  618. /*****************************************************************************/
  619.  
  620.  
  621. /* kinds of objects supported in addition to the normal GadTools kinds */
  622. #define HORIZONTAL_KIND        45
  623. #define VERTICAL_KIND        46
  624. #define END_KIND        47
  625. #define FRAME_KIND        48
  626. #define BOX_KIND        49
  627. #define FRACTION_KIND        50
  628. #define XBAR_KIND        51
  629. #define YBAR_KIND        52
  630. #define PASSWORD_KIND        53
  631. #define GAUGE_KIND        54
  632. #define TAPEDECK_KIND        55
  633. #define LEVEL_KIND        56
  634. #define BOOPSI_KIND        57
  635. #define POPUP_KIND        58
  636. #define TAB_KIND        59
  637.  
  638.  
  639. /*****************************************************************************/
  640.  
  641.  
  642. /* in support of FRACTION_KIND gadgets */
  643.  
  644. typedef ULONG            FIXED;
  645. #define FIXED_UNITY        10000
  646.  
  647. #define TO_FIXED(l,r)        (FIXED_UNITY * (l) + (r))
  648. #define FIXED_LEFT(f)        ((f) / FIXED_UNITY)
  649. #define FIXED_RIGHT(f)        ((f) % FIXED_UNITY)
  650.  
  651.  
  652. /*****************************************************************************/
  653.  
  654.  
  655. #ifndef _GTLAYOUT_GLOBAL_H
  656. typedef struct LayoutHandle
  657. {
  658.     struct Screen        *Screen;
  659.     struct DrawInfo        *DrawInfo;
  660.     struct Window        *Window;
  661.     APTR             VisualInfo;
  662.     struct Image        *AmigaGlyph,
  663.                 *CheckGlyph;
  664.     APTR             UserData;    /* Requires gtlayout.library v9 */
  665.     struct Menu        *Menu;        /* Requires gtlayout.library v13 */
  666.     /* private fields follow.... */
  667. } LayoutHandle;
  668. #endif    /* _GTLAYOUT_GLOBAL_H */
  669.  
  670.  
  671. /*****************************************************************************/
  672.  
  673.  
  674. VOID LIBENT            LT_LevelWidth(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR levelFormat,_REG(a2) DISPFUNC dispFunc,_REG(d0) LONG min,_REG(d1) LONG max,_REG(a3) LONG *maxWidth,_REG(a5) LONG *maxLen,_REG(d2) BOOL fullCheck);
  675. VOID LIBENT            LT_NewLevelWidth(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR levelFormat,_REG(a2) DISPFUNC dispFunc,_REG(d0) LONG min,_REG(d1) LONG max,_REG(a3) LONG *maxWidth,_REG(d3) LONG *maxLen,_REG(d2) BOOL fullCheck);
  676. VOID LIBENT            LT_DeleteHandle(_REG(a0) struct LayoutHandle *Handle);
  677. struct LayoutHandle * LIBENT    LT_CreateHandle(_REG(a0) struct Screen *Screen,_REG(a1) struct TextAttr *Font);
  678. struct LayoutHandle * LIBENT    LT_CreateHandleTagList(_REG(a0) struct Screen *Screen,_REG(a1) struct TagItem *TagList);
  679. BOOL LIBENT            LT_RebuildTagList(_REG(a0) struct LayoutHandle *handle,_REG(d0) BOOL clear,_REG(a1) struct TagItem *TagParams);
  680. VOID LIBENT            LT_HandleInput(_REG(a0) struct LayoutHandle *Handle,_REG(d0) ULONG MsgQualifier,_REG(a1) ULONG *MsgClass,_REG(a2) UWORD *MsgCode,_REG(a3) struct Gadget **MsgGadget);
  681. VOID LIBENT            LT_BeginRefresh(_REG(a0) struct LayoutHandle *handle);
  682. VOID LIBENT            LT_EndRefresh(_REG(a0) struct LayoutHandle *handle,_REG(d0) BOOL complete);
  683. LONG LIBENT            LT_GetAttributesA(_REG(a0) struct LayoutHandle *Handle,_REG(d0) LONG ID,_REG(a1) struct TagItem *TagList);
  684. VOID LIBENT            LT_SetAttributesA(_REG(a0) struct LayoutHandle *handle,_REG(d0) LONG id,_REG(a1) struct TagItem *TagList);
  685. VOID LIBENT            LT_NewA(_REG(a0) struct LayoutHandle *handle,_REG(a1) struct TagItem *tagList);
  686. VOID LIBENT            LT_EndGroup(_REG(a0) struct LayoutHandle *handle);
  687. struct Window * LIBENT        LT_BuildA(_REG(a0) struct LayoutHandle *Handle,_REG(a1) struct TagItem *TagParams);
  688. struct Menu * LIBENT        LT_LayoutMenusA(_REG(a0) struct LayoutHandle *handle,_REG(a1) struct NewMenu *menuTemplate,_REG(a2) struct TagItem *TagParams);
  689. VOID LIBENT            LT_Fixed2String(_REG(d0) FIXED fixed,_REG(d1) STRPTR buffer);
  690. FIXED LIBENT            LT_String2Fixed(_REG(a0) STRPTR buffer);
  691. ULONG LIBENT            LT_FixedMult(_REG(d0) FIXED fixed,_REG(d1) ULONG factor);
  692. LONG LIBENT            LT_LabelWidth(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR label);
  693. LONG LIBENT            LT_LabelChars(_REG(a0) struct LayoutHandle *handle,_REG(a1) STRPTR label);
  694. VOID LIBENT            LT_LockWindow(_REG(a0) struct Window *window);
  695. VOID LIBENT            LT_UnlockWindow(_REG(a0) struct Window *window);
  696. VOID LIBENT            LT_DeleteWindowLock(_REG(a0) struct Window *window);
  697. VOID LIBENT            LT_ShowWindow(_REG(a0) struct LayoutHandle *handle,_REG(a1) BOOL activate);
  698. VOID LIBENT            LT_Activate(_REG(a0) struct LayoutHandle *handle,_REG(d0) LONG id);
  699. VOID LIBENT            LT_PressButton(_REG(a0) struct LayoutHandle *handle,_REG(d0) LONG id);
  700. LONG LIBENT            LT_GetCode(_REG(d0) ULONG MsgQualifier,_REG(d1) ULONG MsgClass,_REG(d2) UWORD MsgCode,_REG(a0) struct Gadget *MsgGadget);
  701. struct IntuiMessage * LIBENT    LT_GetIMsg(_REG(a0) struct LayoutHandle *Handle);
  702. VOID LIBENT            LT_ReplyIMsg(_REG(a0) struct IntuiMessage *Msg);
  703. VOID LIBENT            LT_UpdateStrings(_REG(a0) struct LayoutHandle *Handle);
  704. VOID LIBENT            LT_DisposeMenu(_REG(a0) struct Menu *Menu);
  705. struct Menu * LIBENT        LT_NewMenuTemplate(_REG(a0) struct Screen *Screen,_REG(a1) struct TextAttr *TextAttr,_REG(a2) struct Image *AmigaGlyph,_REG(a3) struct Image *CheckGlyph,_REG(d0) LONG *Error,_REG(d1) struct NewMenu *MenuTemplate);
  706. struct Menu * LIBENT        LT_NewMenuTagList(_REG(a0) struct TagItem *TagList);
  707. VOID LIBENT            LT_MenuControlTagList(_REG(a0) struct Window *Window,_REG(a1) struct Menu *IntuitionMenu,_REG(a2) struct TagItem *Tags);
  708. struct MenuItem * LIBENT    LT_GetMenuItem(_REG(a0) struct Menu *Menu,_REG(d0) ULONG ID);
  709. struct MenuItem * LIBENT    LT_FindMenuCommand(_REG(a0) struct Menu *Menu,_REG(d0) UWORD MsgCode,_REG(d1) UWORD MsgQualifier,_REG(a1) struct Gadget *MsgGadget);
  710. VOID LIBENT            LT_Refresh(_REG(a0) struct LayoutHandle *Handle);
  711.  
  712.  
  713. /*****************************************************************************/
  714.  
  715.  
  716. /* For use as link library */
  717.  
  718. BOOL LIBENT            LT_Init(VOID);
  719. VOID LIBENT            LT_Exit(VOID);
  720.  
  721. /* Available for library-internal use and as link library */
  722.  
  723. BOOL __stdargs            LT_RebuildTags(struct LayoutHandle *handle,BOOL clear,...);
  724. struct LayoutHandle * __stdargs    LT_CreateHandleTags(struct Screen *Screen,...);
  725. LONG __stdargs            LT_GetAttributes(struct LayoutHandle *Handle,LONG ID,...);
  726. VOID __stdargs            LT_SetAttributes(struct LayoutHandle *handle,LONG id,...);
  727. VOID __stdargs            LT_AddL(struct LayoutHandle *handle,LONG type,ULONG labelID,LONG id,...);
  728. VOID __stdargs            LT_Add(struct LayoutHandle *Handle,LONG Type,STRPTR Label,LONG ID,...);
  729. VOID __stdargs            LT_New(struct LayoutHandle *handle,...);
  730. struct Window * __stdargs    LT_Build(struct LayoutHandle *Handle,...);
  731. struct Window * __stdargs    LT_Layout(struct LayoutHandle *handle, STRPTR title,struct IBox *bounds,LONG extraWidth, LONG extraHeight,ULONG IDCMP, LONG align, ...);
  732. struct Menu * __stdargs        LT_LayoutMenus(struct LayoutHandle *handle,struct NewMenu *menuTemplate,...);
  733.  
  734. struct Menu * __stdargs        LT_NewMenuTags(Tag FirstTag,...);
  735. VOID __stdargs            LT_MenuControlTags(struct Window *Window,struct Menu *Menu,...);
  736.  
  737.  
  738. /*****************************************************************************/
  739.  
  740.  
  741. /* Useful macros */
  742.  
  743. #define LT_GetString(Handle,Code)    ((STRPTR)LT_GetAttributesA((Handle),(Code),NULL))
  744.  
  745. #define LAMN_Menu_UserData(m)        (*(APTR *)(((struct Menu *)(m)) + 1))
  746. #define LAMN_Menu_ID(m)            (((ULONG *)(((struct Menu *)(m)) + 1))[1])
  747.  
  748. #define LAMN_Item_UserData(m)        (*(APTR *)(((struct MenuItem *)(m)) + 1))
  749. #define LAMN_Item_ID(m)            (((ULONG *)(((struct MenuItem *)(m)) + 1))[1])
  750.  
  751.  
  752. /*****************************************************************************/
  753.  
  754.  
  755. /* Obsolete routines, do not use in new code. */
  756.  
  757. BOOL LIBENT                LT_Rebuild(_REG(a0) struct LayoutHandle *handle,_REG(a1) struct IBox *bounds,_REG(a2) LONG extraWidth,_REG(d0) LONG extraHeight,_REG(d1) BOOL clear);
  758. struct Window * LIBENT            LT_LayoutA(_REG(a0) struct LayoutHandle *handle, _REG(a1) STRPTR title,_REG(a2) struct IBox *bounds,_REG(d0) LONG extraWidth, _REG(d1) LONG extraHeight,_REG(d2) ULONG IDCMP, _REG(d3) LONG align, _REG(a3) struct TagItem *TagParams);
  759. VOID LIBENT                LT_AddA(_REG(a0) struct LayoutHandle *Handle,_REG(d0) LONG Type,_REG(d1) STRPTR Label,_REG(d2) LONG ID,_REG(a1) struct TagItem *TagList);
  760.  
  761. #define LT_GetDrawInfo(Handle)        ((Handle) ? ((Handle) -> DrawInfo)    : NULL)
  762. #define LT_GetVisualInfo(Handle)    ((Handle) ? ((Handle) -> VisualInfo)    : NULL)
  763. #define LT_GetScreen(Handle)        ((Handle) ? ((Handle) -> Screen)    : NULL)
  764. #define LT_SetAutoActivate(Handle,Mode)    LT_SetAttributes(Handle,0,LH_AutoActivate,Mode,TAG_DONE)
  765.  
  766.  
  767. /*****************************************************************************/
  768.  
  769.  
  770. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(NO_PRAGMAS)
  771. #pragma libcall GTLayoutBase LT_LevelWidth 1e 2DB10A9808
  772. #pragma libcall GTLayoutBase LT_DeleteHandle 24 801
  773. #pragma libcall GTLayoutBase LT_CreateHandle 2a 9802
  774. #pragma libcall GTLayoutBase LT_CreateHandleTagList 30 9802
  775. #ifdef __SASC_60
  776. #pragma tagcall GTLayoutBase LT_CreateHandleTags 30 9802
  777. #endif
  778. #pragma libcall GTLayoutBase LT_Rebuild 36 10A9805
  779. #pragma libcall GTLayoutBase LT_HandleInput 3c BA90805
  780. #pragma libcall GTLayoutBase LT_BeginRefresh 42 801
  781. #pragma libcall GTLayoutBase LT_EndRefresh 48 0802
  782. #pragma libcall GTLayoutBase LT_GetAttributesA 4e 90803
  783. #ifdef __SASC_60
  784. #pragma tagcall GTLayoutBase LT_GetAttributes 4e 90803
  785. #endif
  786. #pragma libcall GTLayoutBase LT_SetAttributesA 54 90803
  787. #ifdef __SASC_60
  788. #pragma tagcall GTLayoutBase LT_SetAttributes 54 90803
  789. #endif
  790. #pragma libcall GTLayoutBase LT_AddA 5a 9210805
  791. #ifdef __SASC_60
  792. #pragma tagcall GTLayoutBase LT_Add 5a 9210805
  793. #endif
  794. #pragma libcall GTLayoutBase LT_NewA 60 9802
  795. #ifdef __SASC_60
  796. #pragma tagcall GTLayoutBase LT_New 60 9802
  797. #endif
  798. #pragma libcall GTLayoutBase LT_EndGroup 66 801
  799. #pragma libcall GTLayoutBase LT_LayoutA 6c B3210A9808
  800. #ifdef __SASC_60
  801. #pragma tagcall GTLayoutBase LT_Layout 6c B3210A9808
  802. #endif
  803. #pragma libcall GTLayoutBase LT_LayoutMenusA 72 A9803
  804. #ifdef __SASC_60
  805. #pragma tagcall GTLayoutBase LT_LayoutMenus 72 A9803
  806. #endif
  807. #pragma libcall GTLayoutBase LT_Fixed2String 78 1002
  808. #pragma libcall GTLayoutBase LT_String2Fixed 7e 801
  809. #pragma libcall GTLayoutBase LT_FixedMult 84 1002
  810. #pragma libcall GTLayoutBase LT_LabelWidth 8a 9802
  811. #pragma libcall GTLayoutBase LT_LabelChars 90 9802
  812. #pragma libcall GTLayoutBase LT_LockWindow 96 801
  813. #pragma libcall GTLayoutBase LT_UnlockWindow 9c 801
  814. #pragma libcall GTLayoutBase LT_DeleteWindowLock a2 801
  815. #pragma libcall GTLayoutBase LT_ShowWindow a8 9802
  816. #pragma libcall GTLayoutBase LT_Activate ae 0802
  817. #pragma libcall GTLayoutBase LT_PressButton b4 0802
  818. #pragma libcall GTLayoutBase LT_GetCode ba 821004
  819. /*--- Added in v1.78 --------------------------------------------------*/
  820. #pragma libcall GTLayoutBase LT_GetIMsg c0 801
  821. #pragma libcall GTLayoutBase LT_ReplyIMsg c6 801
  822. /*--- Added in v3.0 ---------------------------------------------------*/
  823. #pragma libcall GTLayoutBase LT_BuildA cc 9802
  824. #ifdef __SASC_60
  825. #pragma tagcall GTLayoutBase LT_Build cc 9802
  826. #endif
  827. #pragma libcall GTLayoutBase LT_RebuildTagList d2 90803
  828. #ifdef __SASC_60
  829. #pragma tagcall GTLayoutBase LT_RebuildTags d2 90803
  830. #endif
  831. /*--- Added in v9.0 ---------------------------------------------------*/
  832. #pragma libcall GTLayoutBase LT_UpdateStrings d8 801
  833. /*--- Added in v11.0 ---------------------------------------------------*/
  834. #pragma libcall GTLayoutBase LT_DisposeMenu de 801
  835. #pragma libcall GTLayoutBase LT_NewMenuTemplate e4 10BA9806
  836. #pragma libcall GTLayoutBase LT_NewMenuTagList ea 801
  837. #ifdef __SASC_60
  838. #pragma tagcall GTLayoutBase LT_NewMenuTags ea 801
  839. #endif
  840. #pragma libcall GTLayoutBase LT_MenuControlTagList f0 A9803
  841. #ifdef __SASC_60
  842. #pragma tagcall GTLayoutBase LT_MenuControlTags f0 A9803
  843. #endif
  844. #pragma libcall GTLayoutBase LT_GetMenuItem f6 0802
  845. #pragma libcall GTLayoutBase LT_FindMenuCommand fc 910804
  846. /*--- Added in v14.0 ---------------------------------------------------*/
  847. #pragma libcall GTLayoutBase LT_NewLevelWidth 102 23B10A9808
  848. /*--- Added in v31.0 ---------------------------------------------------*/
  849. #pragma libcall GTLayoutBase LT_Refresh 108 801
  850. #endif    /* !_GTLAYOUT_GLOBAL_H && !NO_PRAGMAS */
  851.  
  852.  
  853. /*****************************************************************************/
  854.  
  855.  
  856. #endif    /* _GTLAYOUT_H */
  857.